<template>
    <div>
        <detail-nav-bar></detail-nav-bar>
        <detail-swiper :topImages="topImages"></detail-swiper>
    </div>
</template>
<script>
import DetailNavBar from './childComps/DetailNavBar'
import DetailSwiper from './childComps/DetailSwiper'

import { getDetailGoods } from 'network/detail.js'
export default {
    name: 'Detail',
    components: {
        DetailNavBar,
        DetailSwiper
    },
    data() {
        return {
            id: null,
            topImages: []
        }
    },
    created() {
        this.id = this.$route.params.id
        //this.getDetailGoods(this.id)
        this.getDetailGoods(33)
    },
    methods: {
        getDetailGoods(id) {
            getDetailGoods(id).then(res => {
                this.topImages = res.result.itemInfo.topImage
            })
        }
    }
}
</script>
<style scoped>

</style>

